import { ControlVOBase, EditFormService } from '@core';
import { ComplianceGuideService } from '@api/compliance-guide/compliance-guide-service';

/**
 * 部件展示数据对象
 * @export
 * @class ControlVO
 */
export class ControlVO extends ControlVOBase {
  /**
   * 用后台数据对象创建部件数据对象
   * @param data 后台数据
   */
  constructor(data: any){
    super(data);
    // 记录没有映射的属性
    this.$ownKeys =['srfupdatedate','srforikey','srfkey','srfmajortext','srftempmode','srfuf','srfdeid','srfsourcekey','ls_compliance_guidename','draftman','deptname','draftdate','createmantelnum','num','attachment','memo','draftmanid','deptid','ls_compliance_guideid'];  
  }

  // 表单里映射了属性的字段
  get srfupdatedate() {
    return this.$DO.updatedate;
  }
  set srfupdatedate(value: any) {
    this.$DO.updatedate = value;
  }

  get srfkey() {
    return this.$DO.complianceguideid;
  }
  set srfkey(value: any) {
    this.$DO.complianceguideid = value;
  }

  get srfmajortext() {
    return this.$DO.complianceguidename;
  }
  set srfmajortext(value: any) {
    this.$DO.complianceguidename = value;
  }

  get ls_compliance_guidename() {
    return this.$DO.complianceguidename;
  }
  set ls_compliance_guidename(value: any) {
    this.$DO.complianceguidename = value;
  }

  get draftman() {
    return this.$DO.draftman;
  }
  set draftman(value: any) {
    this.$DO.draftman = value;
  }

  get deptname() {
    return this.$DO.deptname;
  }
  set deptname(value: any) {
    this.$DO.deptname = value;
  }

  get draftdate() {
    return this.$DO.draftdate;
  }
  set draftdate(value: any) {
    this.$DO.draftdate = value;
  }

  get createmantelnum() {
    return this.$DO.createmantelnum;
  }
  set createmantelnum(value: any) {
    this.$DO.createmantelnum = value;
  }

  get num() {
    return this.$DO.num;
  }
  set num(value: any) {
    this.$DO.num = value;
  }

  get attachment() {
    return this.$DO.attachment;
  }
  set attachment(value: any) {
    this.$DO.attachment = value;
  }

  get memo() {
    return this.$DO.memo;
  }
  set memo(value: any) {
    this.$DO.memo = value;
  }

  get draftmanid() {
    return this.$DO.draftmanid;
  }
  set draftmanid(value: any) {
    this.$DO.draftmanid = value;
  }

  get deptid() {
    return this.$DO.deptid;
  }
  set deptid(value: any) {
    this.$DO.deptid = value;
  }

  get ls_compliance_guideid() {
    return this.$DO.complianceguideid;
  }
  set ls_compliance_guideid(value: any) {
    this.$DO.complianceguideid = value;
  }


  // 表单里没有映射实体属性的字段(srfuf除外)
  srforikey: any;
  srftempmode: any;
  srfdeid: any;
  srfsourcekey: any;
}

// 部件配置对象
export const ctrlState = {
  controlCodeName: 'WFStartForm',
  controlName: 'form',
  controlService: new EditFormService<ControlVO>(ControlVO, new ComplianceGuideService() ),
  data: new ControlVO({}),
  appDeMajorFieldName: 'ComplianceGuideName',
  appDeKeyFieldName: 'ComplianceGuideId',
  enableAutoSave: false,
  detailsModel: {
    formpage1: {
      caption: '基本信息',
      name: 'formpage1',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMPAGE',
      showCaption: false,
    },
    group1: {
      caption: '合规指引基本信息',
      name: 'group1',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'GROUPPANEL',
      showCaption: false,
    },
    ls_compliance_guidename: {
      caption: '标题',
      name: 'ls_compliance_guidename',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMITEM',
      showCaption: true,
      valueFormat: '',
      dataType: '25',
      required: true,
      enableCond: 3,
    },
    draftman: {
      caption: '起草人',
      name: 'draftman',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMITEM',
      showCaption: true,
      valueFormat: '',
      dataType: '25',
      required: false,
      enableCond: 0,
      createDVT: "OPERATORNAME",
      createDV: "",
    },
    deptname: {
      caption: '组织部门名称',
      name: 'deptname',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMITEM',
      showCaption: true,
      valueFormat: '',
      dataType: '25',
      required: false,
      enableCond: 0,
      createDVT: "APPDATA",
      createDV: "srforgsectorname",
    },
    draftdate: {
      caption: '起草时间',
      name: 'draftdate',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMITEM',
      showCaption: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
      dataType: '5',
      required: false,
      enableCond: 0,
      createDVT: "CURTIME",
      createDV: "",
    },
    createmantelnum: {
      caption: '联系电话',
      name: 'createmantelnum',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMITEM',
      showCaption: true,
      valueFormat: '',
      dataType: '25',
      required: false,
      enableCond: 0,
    },
    num: {
      caption: '单号',
      name: 'num',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMITEM',
      showCaption: true,
      valueFormat: '',
      dataType: '25',
      required: false,
      enableCond: 0,
    },
    attachment: {
      caption: '合规指引文件',
      name: 'attachment',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMITEM',
      showCaption: true,
      valueFormat: '',
      dataType: '21',
      required: true,
      enableCond: 3,
    },
    memo: {
      caption: '发布说明',
      name: 'memo',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMITEM',
      showCaption: true,
      valueFormat: '',
      dataType: '21',
      required: true,
      enableCond: 3,
    },
    draftmanid: {
      caption: '起草人id',
      name: 'draftmanid',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMITEM',
      showCaption: true,
      valueFormat: '',
      dataType: '25',
      required: false,
      enableCond: 3,
      createDVT: "APPDATA",
      createDV: "srfpersonid",
    },
    deptid: {
      caption: '组织部门标识',
      name: 'deptid',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMITEM',
      showCaption: true,
      valueFormat: '',
      dataType: '25',
      required: false,
      enableCond: 3,
      createDVT: "APPDATA",
      createDV: "srforgsectorid",
    },
  },
  actionModel: {
  },
  rules: {
  },
};